package cn.tedu.mybatisplusdemo.service.impl;

import cn.tedu.mybatisplusdemo.entity.User;
import cn.tedu.mybatisplusdemo.mapper.TUserMapper;
import cn.tedu.mybatisplusdemo.model.TUser;
import cn.tedu.mybatisplusdemo.service.ITUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 这是用户信息表 服务实现类
 * </p>
 *
 * @author chengSir
 * @since 2022-11-10
 */
@Service
public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements ITUserService {

    @Autowired
    private TUserMapper userMapper;
    /**
     * 查询所有的用户数据
     * @return 返回查询到的所有用户数据
     */
    @Override
    public List<TUser> findAll(int pageNum,int pageSize) {
        // 使用分页工具进行分页
        PageHelper.startPage(pageNum,pageSize);
        List<TUser> users = userMapper.selectList(null);
        return users;
    }
}
